<?php
/*
	插件概览
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$plugin_name = $_RQ['basicname'] ? $_RQ['basicname'] : '';
if($_RQ['op']=='get'){
	//显示统计数据
	$member['all']=pdo_count('core_members',array('uniacid'=>$_SESSION['uniacid']));
	$member['day']=pdo_count('core_members',array('uniacid'=>$_SESSION['uniacid'],'createtime >'=>strtotime(date('ymd'))));
	$list['all']=pdo_count('jy_adbaoming_list',array('uniacid'=>$_SESSION['uniacid']));
	$data=pdo_getall('jy_adbaoming_list',array('uniacid'=>$_SESSION['uniacid']));
	if($data){
		foreach($data as &$item){
				$likenum += $item['likenum'];
				$readnum += $item['readnum'];
		}
	}
	$list['day']=pdo_count('jy_adbaoming_list',array('uniacid'=>$_SESSION['uniacid'],'createtime >'=>strtotime(date('ymd'))));
	$cmsdatas = array(
		array('title'=>'用户总量','num'=>1,'data' => $member['all']),
		array('title'=>'今日用户','num'=>1,'data' => $member['day']),
		array('title'=>'活动总量','num'=>1,'data' => $list['all']),
		array('title'=>'今日活动','num'=>1,'data' => $list['day']),
	);
	$appdatas = array(
		array('name'=>'用户总量','num'=>1,'value' => $member['all']),
		array('name'=>'今日用户','num'=>1,'value' => $member['day']),
		array('name'=>'活动总量','num'=>1,'value' => $list['all']),
		array('name'=>'今日活动','num'=>1,'value' => $list['day']),
	);
	$appmdatas = array(
		array('name'=>'点赞总量','num'=>1,'value' => $likenum),
		array('name'=>'阅读总量','num'=>1,'value' => $readnum),
		array('name'=>'用户总量','num'=>1,'value' => $member['all']),
		array('name'=>'活动总量','num'=>1,'value' => $list['all']),
	);
	$htmls=array(
		array('type'=>'data','num'=>12,'one_num'=>3,'title'=>'活动数据','datas'=>$cmsdatas),
		array('type'=>'echarts_pie','one_num'=>2,'width'=>'50%','ecid'=>'member','title'=>'活动用户分布图','datas'=>array(
					'time' => date("Y-m-d H:i:s", time()),
					'datas'=>$appdatas,
		)),
		array('type'=>'echarts_pie','one_num'=>2,'width'=>'50%','ecid'=>'message','title'=>'活动数据分布图','datas'=>array(
					'time' => date("Y-m-d H:i:s", time()),
					'datas'=>$appmdatas,
		)),
	);
	$return=array('htmls'=>$htmls);
	exi($return);
}